#include "music_acceptor.h"

void user_handler::music_acceptor::handle_event(
		boost::shared_ptr<network::message> e) 
{
	// accepting the connection...
	if(e->type == network::CONNECT) {
		boost::shared_ptr<user_handler::music_handler> han(
		  user_handler::music_handler::create(e->new_sock, _music));
		boost::shared_ptr<handler::multicaster> multi(_multi.lock());
		multi->add_handler(network::RECEIVE, e->new_sock, han);
		multi->add_handler(network::DELETE, e->new_sock, han);
		_mgr->add_recv(e->new_sock, 
			network::configurator::get_music_filetype());
	}
}

